using System;
using FytSoa.Common.Extensions;
using FytSoa.Common.Utils;
using Newtonsoft.Json;
using System.ComponentModel.DataAnnotations;

namespace FytSoa.Application.Sys
{
    /// <summary>
    /// 资源文件信息表 
    /// </summary>
    public partial class SysFileInfoDto
    {
        public SysFileInfoDto()
        {
            Id = Unique.Id();
        }
        
        /// <summary>
        /// 唯一编号
        /// </summary>
        [JsonConverter(typeof(ConverterExtension), ConverterExtensionShip.UInt64)]
        public long Id { get; set; }

        /// <summary>
        /// 所属栏目
        /// </summary>
        [Required]
        [JsonConverter(typeof(ConverterExtension), ConverterExtensionShip.UInt64)]
        public long ColumnId { get; set; }

        /// <summary>
        /// 文件名称
        /// </summary>
        [Required]
        [StringLength(100)]
        public string Name { get; set; }

        /// <summary>
        /// 文件地址
        /// </summary>
        public string FileUrl { get; set; }

        /// <summary>
        /// 文件类型
        /// </summary>
        [Required]
        [StringLength(32)]
        public string FileType { get; set; }

        /// <summary>
        /// 文件大小
        /// </summary>
        [Required]
        [JsonConverter(typeof(ConverterExtension), ConverterExtensionShip.UInt64)]
        public long FileSize { get; set; }

        /// <summary>
        /// 图片缩略图
        /// </summary>
        public string ImgSmall { get; set; }

        /// <summary>
        /// 排序
        /// </summary>
        [Required]
        public int Sort { get; set; } = 1;

        /// <summary>
        /// 是否删除
        /// </summary>
        public bool IsDel { get; set; }

        /// <summary>
        /// 添加时间
        /// </summary>
        public DateTime CreateTime { get; set; }

        /// <summary>
        /// 添加人
        /// </summary>
        public string CreateUser { get; set; }

        /// <summary>
        /// 修改时间
        /// </summary>
        public DateTime UpdateTime { get; set; }

        /// <summary>
        /// 修改人
        /// </summary>
        public string UpdateUser { get; set; }


    }

    /// <summary>
    /// 文件具体内容
    /// </summary>
    public class FileDto
    {

        /// <summary>
        /// 文件地址
        /// </summary>
        public string path { get; set; }

        /// <summary>
        /// 文件名称
        /// </summary>
        public string name { get; set; }

        /// <summary>
        /// 文件大小
        /// </summary>
        public Int64 size { get; set; } = 0;
    }
}